﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using filmquiz.Src.DatabaseAccess;

namespace filmquiz.Src.Domain
{
    /// <summary>
    /// Summary description for User
    /// </summary>
    public class User
    {
        private int userID;
        private String name;
        private String email;
        private bool[] questions;
        private bool admin;

        public User()
        {
            questions = new bool[Statics.getInstance().getNumberOfQuestions()];
        }

        public void setName(String name)
        {
            this.name = name;
        }

        public void setEmail(String email)
        {
            this.email = email;
        }

        public String getName()
        {
            return name;
        }

        public String getEmail()
        {
            return email;
        }

        public Boolean[] getQuestions()
        {
            return questions;
        }

        public void setUserID(int userID)
        {
            this.userID = userID;
        }

        public int getUserID()
        {
            return userID;
        }

        public void setQuestionTrue(int question)
        {
            questions[question - 1] = true;
            QuizHelper.getInstance().setCorrectAnswer(question, userID);
        }

        public void setQuestionTrueArray(int question)
        {
            questions[question - 1] = true;

        }

        public void setAdmin(bool admin)
        {
            this.admin = admin;
        }

        public bool getAdmin()
        {
            return admin;
        }
    }
}